package com.cll.learn.rabbitmq.service.impl;

import com.cll.learn.rabbitmq.entity.Goods;
import com.cll.learn.rabbitmq.mapper.GoodsMapper;
import com.cll.learn.rabbitmq.service.GoodsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2021/2/4 15:03
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    private static final Logger logger = LoggerFactory.getLogger(GoodsServiceImpl.class);

    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public List<Goods> listAll() {
        logger.info("===>>> 服务层查询商品列表");
        return goodsMapper.listAll();
    }

    @Override
    public Goods selectById(Integer goodsId) {
        logger.info("===>>> 服务层根据商品ID查询商品详情");
        return goodsMapper.selectById(goodsId);
    }
}
